{% extends 'base_with_top_menu.html' %}

{% block title %}Book copy's details{% endblock %}

{% block header %}Book copy's details{% endblock %}

{% block go_up %} 
    <div class="goUpWrapper">
        <a href="../../">Up</a>
    </div>
{% endblock %} 
        
{% block content %}
<div class="copy_one">
  <div class="inner_menu">
    <ul>
      <li><a href="{% url book_all %}">Show all books</a> </li>
      <li><a href="{% url book_one book.id %}">Show related book</a> </li>
      {%if is_updating%}<li><a href="{% url copy_one copy.id %}">Show this copy</a></li>{% endif %}
  </div>
  
  <!--
    <p class="links">
      <a href="{% url book_all %}">Show all books</a> 
      <a href="{% url book_one book.id %}">Show related book</a> 
      {%if is_updating%}<a href="{% url copy_one copy.id %}">Show this copy</a>{% endif %}
    </p>
  -->
    
    {% if perms.baseapp.add_bookcopy %}
    <div class="form_copyWrapper">
        <!-- <h2 id="new_copy">New bookcopy</h2> -->
        
        <form method="POST" action="." name="Fcopy">
            {{ form.non_field_errors }}
            <table>
                {% for field in form %}
                    <tr>
                        <td>
                            {{ field.label_tag }}: <br /> {{ field }}
                        </td>
                        <td> 
                            {% if field.label == 'Publisher' %}
                                <a href='{% url publisher_add %}' class='add_new_publisher' target='_blank'>New publisher</a>
                                <a href='javascript:location.reload()' class='refresh'>Refresh</a>
                            {% endif %}
                        </td>
                        <td>{{ field.errors }}</td>
                    </tr>
                {% endfor %}
                <tr>
                    <td></td>
                    {% if is_adding %}<td><input type="submit" value="Add book copy"></td> {%endif%}
                    {% if is_updating %}<td><input type="submit" value="Update book copy"></td> {%endif%}
                </tr>
            </table>
        </form>
        <script type="text/javascript"> 
            document.Fcopy.shelf_mark.focus();
        </script> 
    </div>
    {% endif %}
    
</div>
{% endblock %}
